package com.adcc.ags.cgw.entity.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * 用户实体
 */
public class User {

    // ID
    private String id = Strings.nullToEmpty("");

    // 名称
    private String name = Strings.nullToEmpty("");

    // 发送队列
    private String sendQueue = Strings.nullToEmpty("");

    // 接收队列
    private String recvQueue = Strings.nullToEmpty("");

    // 消息类型
    private MsgType msgType = MsgType.RawMsg;

    // 下行转发
    private boolean downlinkForward = false;

    // 是否为应急用户
    private boolean isEmergency = false;

    // 用户路由
    private List<Route> routeList = Lists.newArrayList();

    /**
     * 构造函数
     */
    public User(){

    }

    /**
     * 构造函数
     * @param id
     * @param name
     */
    public User(String id, String  name) {
        this.id = id;
        this.name = name;
    }

    @JsonProperty("id")
    public String getId() {
        return id;
    }

    @JsonProperty("id")
    public void setId(String id) {
        this.id = id;
    }

    @JsonProperty("name")
    public String getName() {
        return name;
    }

    @JsonProperty("name")
    public void setName(String name) {
        this.name = name;
    }

    @JsonIgnore
    public String getSendQueue() {
        return sendQueue;
    }

    @JsonIgnore
    public void setSendQueue(String sendQueue) {
        this.sendQueue = sendQueue;
    }

    @JsonIgnore
    public String getRecvQueue() {
        return recvQueue;
    }

    @JsonIgnore
    public void setRecvQueue(String recvQueue) {
        this.recvQueue = recvQueue;
    }

    @JsonIgnore
    public MsgType getMsgType() {
        return msgType;
    }

    @JsonIgnore
    public void setMsgType(MsgType msgType) {
        this.msgType = msgType;
    }

    @JsonIgnore
    public boolean isDownlinkForward() {
        return downlinkForward;
    }

    @JsonIgnore
    public void setDownlinkForward(boolean downlinkForward) {
        this.downlinkForward = downlinkForward;
    }

    @JsonIgnore
    public boolean isEmergency() {
        return isEmergency;
    }

    @JsonIgnore
    public void setEmergency(boolean emergency) {
        this.isEmergency = emergency;
    }

    @JsonIgnore
    public List<Route> getRouteList() {
        return routeList;
    }

    @JsonIgnore
    public void setRouteList(List<Route> routeList) {
        this.routeList = routeList;
    }
}
